home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / v cisle / acehtml / acehtmlfreeware.exe / scriptdef / Driving Distances.sd < prev    next >
INI File  |  2004-06-28  |  11KB  |  278 lines

  1. [SUBJECT]
  2. Description=Calculate the driving distances between selected USA cities
  3. ImageIndex=-1
  4. Folder=Mathematics
  5.  
  6.  
  7. [HEAD_TEXT]
  8. ;<!-- Cut-N-Paste JavaScript from ISN Toolbox 
  9. ;     Copyright 1996, Infohiway, Inc.  Restricted use is hereby
  10. ;     granted (commercial and personal OK) so long as this code
  11. ;     is not *directly* sold and the copyright notice is buried
  12. ;     somewhere deep in your HTML document.  A link to our site
  13. ;     http://www.infohiway.com is always appreciated of course,
  14. ;     but is absolutely and positively not necessary. ;-)   -->
  15. ;     
  16. ;<script language="JavaScript">
  17. ;<!-- Hide from JavaScript-Impaired Browsers
  18. ;var l=0;
  19. ;var r=0;
  20. ;var tc="";
  21. ;var al=" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  22. ;+"123456789";
  23. ;var ns="0123456789";
  24. ;
  25. ;function iA(){
  26. ; this.length=iA.arguments.length;
  27. ; for (var i=0;i<this.length;i++){
  28. ;  this[i]=iA.arguments[i];
  29. ; }
  30. ;}
  31. ;/* 5829 byte database of distances uses position in the
  32. ;   string "al" to substitute for the numerics, saving a bit
  33. ;   over 10k download to visitors. */
  34. ;var a=new iA(61);
  35. ;a[0]="Albany, New York*  tdjaddcdu jgybagc hhfdggqihbdhhbfdphrc"
  36. ;+"khfevbniu aaqghamejgm zcmfBehflcn iclejcndafeao malcbfxidebdC"
  37. ;+"bqiAfjdvesgBeChxid ni";
  38. ;a[1]="Albuquerque, New Mexico*  n xfriiileidvbqgq p pcedmaoipbn"
  39. ;+"ffdddigofbglidcu helgjepdgheihhhalijasgmhlblcl t riedhiqdsedf"
  40. ;+"pcw mghbjbjdf gchakanereei";
  41. ;a[2]="Atlanta, Georgia*  mcfer aevbkaiabie bdnhgagcbaeihbncifgc"
  42. ;+"ndmipfifgiecd cahbsheeuidbchffh kbbedhheefhcjadcgercfhkgzfobx"
  43. ;+"aegscj uexhzcfbie";
  44. ;a[3]="Augusta, Maine*  fgxgoaCfbggclbjdkavblehglajatbvdogjfzcri"
  45. ;+"yacgublbqengqbDcqgG lepcrcmbpdnbraeahiscqapbeiCbhfagGhueEdnfz"
  46. ;+"dviFgGhFfgbrh";
  47. ;a[4]="Baltimore, Maryland*  sbggxadccgegcfdbpggbcfebdcmfpdjdeas"
  48. ;+"hmes cbn egjagejgx jdzefdiajigikag kdb bcmakehia wabeedB pczb"
  49. ;+"hctgpczhBbAa dlh";
  50. ;a[5]="Billings, Montana*  qhfav qbuhqbt dflcpatfpanbeeihoblffaf"
  51. ;+"gu oinaqbv jdjenbldocnfybkfhcp rctdthkeiavcshl pfvgi cbifmafd"
  52. ;+"obmakihcuaje";
  53. ;a[6]="Birmingham, Alabama*  tglci ddefcinbffgccfegfdmchcgflgm p"
  54. ;+"cjhg dhbedfgcrcdctecfbfgegdjgaiceihgagbhheehgphgimdyinavheaqi"
  55. ;+"hfsiwgydgdhc";
  56. ;a[7]="Boise, Idaho*  zivaxiudwegcqatcwisgoihdmfshl lafczarbretd"
  57. ;+"xgnbfgqghescrbBgqdnhshuexiybndldzdxcihucAidcifdcpgcdpgihfeebw"
  58. ;+"gmf";
  59. ;a[8]="Boston, Massachusetts*  dgidgehesbj ffifh qet mdh whpevga"
  60. ;+"arcicnfkfndAendDbifmdobjimijioabaehpingm cbzgegaaEdsaBglawhtb"
  61. ;+"BhEcDbdepc";
  62. ;a[9]="Buffalo, New York*  icdegao edaih ccmfoehecfsgkiqidbnieak"
  63. ;+"bjijavhjfyheeibn fciegblfcgf lbjbl cfvbbbedzgncxegesdpcyczgyh"
  64. ;+"dal ";
  65. ;a[10]="Charleston, South Carolina*  dhbaqaiagcaafejiqbl hdq oas"
  66. ;+"fhcjegbfgbdkavhhcxifag eijbmcedgcggddkdlgchffubfejeCeraAbhfui"
  67. ;+"lhxbBbCcecld";
  68. ;a[11]="Charleston, West Virginia*  bgnadgbecfagjemggid phkdpbfh"
  69. ;+"khcbh ffgfucgcxabffcjaefhgdbiaeedajbidh dhshbchhyemgwheardmcw"
  70. ;+"dz xgcdif";
  71. ;a[12]="Charlotte, North Carolina*  pbgdeb iddjfohjffcpemhrbgdjc"
  72. ;+"eefcciigv ghxadffcgdhckedbgbfbcak kdeceatce ifAhpezbgcthldxaA"
  73. ;+"bAdchji";
  74. ;a[13]="Cheyenne, Wyoming*  ihmcpfm hha fdldgighcerekajhlgqefhhe"
  75. ;+"jgkbl kduej hhlfmhqer fie rgqfidnctfkhcbigidddjfkikilepdfb";
  76. ;a[14]="Chicago, Illinois*  ceh cfibjbcdbhnffelgiajiaigejaedqhff"
  77. ;+"tec edn  idadgibhahghcdhkegiqddhjiubiasebinblatiugtegagc";
  78. ;a[15]="Cleveland, Ohio*  faadkimfffagqdj paefmacbidiahbtihgwhce"
  79. ;+"gcleddgfecjfdgeajchcjedctcacgcxcldvfehqfnewixhwicfja";
  80. ;a[16]="Columbia, South Carolina*  ecjcpbkagbpcncrdhajcfaf c jbu"
  81. ;+"igfxbe fbfdhhladdfigbcijfkhddfatceijdBdpizaghublcwhAgAidhkg";
  82. ;a[17]="Columbus, Ohio*  jeldffaip ieniffkgahh hcfhtbgcvdbaeikgd"
  83. ;+"gghchibefefibgiifdhs aihgxdldvadbphmavfxcwedchg";
  84. ;a[18]="Dallas/Ft Worth, Texas*  ghg kffbjiihpibehidajdealccbn h"
  85. ;+"cdemdjbieffebofmebaffk ndj larhtdjipgfflfbgmeqeucmacg";
  86. ;a[19]="Denver, Colorado*  fglhfihhbet jcjfl qdfagfidjckbjduajdi"
  87. ;+"bkhlhqiqgfcedrhqdhanctglfdbjchfeciek lfmdpbeb";
  88. ;a[20]="Des Moines, Iowa*  eikcdhibleiddhhcldb ncefqaeifboicgbef"
  89. ;+"iihkbkeeeacmfjincghn rbfdp cgjgihqgrcr jfci";
  90. ;a[21]="Detroit, Michigan*  pgibobgclhbhifjeggtbhhvichgbmicffied"
  91. ;+"jgfegcjcgckgfatac i whkiv ecpgnewgx wcebif";
  92. ;a[22]="El Paso, Texas*  nefgvigdnbjcohidgbidhbnejgs odnflhk ues"
  93. ;+"efhlephtgddqhxfpcjdkgkhhgefgcl qbschd";
  94. ;a[23]="Fargo, North Dakota*  kaofm hcmapifbodjdraidkct egbdkamh"
  95. ;+"nenghgdcrancpikcqcnieaohhekemcrgrbnbmcgc";
  96. ;a[24]="Grand Junction, Colorado*  uelbmcnasfhfeakeghmglgw likfn"
  97. ;+"bngtdtbhbgitgsiehpiwdjeffgekabijiheihkcrhgc";
  98. ;a[25]="Hartford, Connecticut*  qchdmejemdzfmdC hgl nbj mbj ncab"
  99. ;+"dipdmgk baygdgb D rbB jhvgsaC DhCecfoc";
  100. ;a[26]="Houston, Texas*  j dbhigdngdcodidegkikhkhghcepamedfhfiho"
  101. ;+"akfmgsfvdmbrhghndb nisawgmgfb";
  102. ;a[27]="Indianapolis, Indiana*  fghde rdfatfaadgkibgeibhh gcgagd"
  103. ;+"faigffqccfjevdkatfbdogkithviveehfi";
  104. ;a[28]="Jackson, Mississippi*  fafipcbfrbeibaiahcjfdabalbieefhgg"
  105. ;+" kanfidoixemgthe pffgqfueydiggf";
  106. ;a[29]="Jacksonville, Florida*  kdvdhbwegcficekanfefefiefbkembad"
  107. ;+"het hcmaCfrczihhwajhwfAeCggblh";
  108. ;a[30]="Kansas City, Kansas/Missouri*  mgdboheadhnhefddehhdlckfc"
  109. ;+"eailekgldhgofrbfipdbfkaghoirfrfjdb ";
  110. ;a[31]="Las Vegas, Nevada*  nfbgrgp ygr pfraqcygxhkam wexhbivaBf"
  111. ;+"j kadepbdblicdegkhxbkh";
  112. ;a[32]="Little Rock, Arkansas*  pieaadkfgghccedblejbcdehifkdmci "
  113. ;+"uikdsad ndehpgsivejadd";
  114. ;a[33]="Los Angeles, California*  uhraAbtgrftarfAizimdogxcA cixc"
  115. ;+"Edifmfdgrdfimiaccikczemi";
  116. ;a[34]="Louisville, Kentucky*  chjichgaagg ggfegeg hfgaqecik wal"
  117. ;+"audbfpbk tiwewef g ";
  118. ;a[35]="Memphis, Tennessee*  j fbiabadak hhdhfdghjanggfnfwaketcb"
  119. ;+"hoegcraubwbheeh";
  120. ;a[36]="Miami, Florida*  nfqgiahfmcigo pdbclcwekhpfFfuhD lcygmiz"
  121. ;+"hDiG jfp ";
  122. ;a[37]="Milwaukee, Wisconsin*  cdeejchiiehhe lbhgqgefkftbhdsfchn"
  123. ;+"cliucugshhage";
  124. ;a[38]="Minneapolis, Minnesota*  hcmelblcgichogl phhingqbehrcfck"
  125. ;+"ilet shpejifc";
  126. ;a[39]="Nashville, Tennessee*  eci fgfhgffigipgegl wglevbcbq ict"
  127. ;+" wcxdffgd";
  128. ;a[40]="New Orleans, Louisiana*  mdjdfijcfelco kdpdydo vcg qheer"
  129. ;+"dvhyik he";
  130. ;a[41]="New York City, New York*  cgnhlejiaaxechcbCaqbAaihuirbB "
  131. ;+"CcBdbdnb";
  132. ;a[42]="Norfolk, Virginia*  mgmbggbgwedbgcCgqfAii vboezhD Biaimg";
  133. ;a[43]="Oklahoma City, Oklahoma*  dflcmiihkaqdrgheofe k dhmcpfsi"
  134. ;+"mcaf";
  135. ;a[44]="Omaha, Nebraska*  nal meicocpiecngddididpcpipikdc ";
  136. ;a[45]="Orlando, Florida*  iithihn DgsgBdj wdkgxaBgDihemi";
  137. ;a[46]="Philadelphia, Pennsylvania*  wgcadbBfpezei ueqdAgC Bbacmf";
  138. ;a[47]="Phoenix, Arizona*  tiAelglcgcnhfej cegfngw jd";
  139. ;a[48]="Pittsburgh, Pennsylvania*  fiyemfwgfasbnhxdzaybbeje";
  140. ;a[49]="Portland, Maine*  FbshCglhyaucE FbDiefqa";
  141. ;a[50]="Portland, Oregon*  lfehtfgfu jifdagAhqe";
  142. ;a[51]="Rapid City, South Dakota*  lciegdleninekcoigc";
  143. ;a[52]="Reno, Nevada*  riecqcf bcgcygnh";
  144. ;a[53]="St Louis, Missouri*  mfiercubudhfdf";
  145. ;a[54]="Salt Lake City, Utah*  mcgfgehetejb";
  146. ;a[55]="San Antonio, Texas*  m qduhoifd";
  147. ;a[56]="San Diego, California*  ealfz n ";
  148. ;a[57]="San Francisco, California*  haBdq ";
  149. ;a[58]="Seattle, Washington*  Abrf";
  150. ;a[59]="Washington, DC*  lh";
  151. ;a[60]="Wichita, Kansas*  ";
  152. ;// For string to numerics on Win3.x
  153. ;var b=new iA(4);
  154. ;b[0]=1;
  155. ;b[1]=10;
  156. ;b[2]=100;
  157. ;b[3]=1000;
  158. ;function getMiles(form){
  159. ; lf=(document.isn.isn1.options[document.isn.isn1.selectedIndex].value);
  160. ; rf=(document.isn.isn2.options[document.isn.isn2.selectedIndex].value);
  161. ; l=al.indexOf(lf);
  162. ; r=al.indexOf(rf);
  163. ; if (r<l){
  164. ;  l=r;
  165. ;  r=al.indexOf(lf);
  166. ;  }
  167. ; ls=a[l];
  168. ; pos=ls.indexOf("*");
  169. ; ls1="From "+ls.substring(0,pos)+" to "
  170. ; +a[r].substring(0,a[r].indexOf("*"))+" is about ";
  171. ; ls=ls.substring(pos+1,ls.length);
  172. ; tc=ls.substring(((r*2)-(l*2)),ls.length);
  173. ; if (document.isn.rb[1].checked){
  174. ;  dispKm();
  175. ;  }
  176. ; else{
  177. ;  dispMi();
  178. ;  }
  179. ;}
  180. ;function dispMi(){
  181. ; ch=tc.charAt(0);
  182. ; ls1+=al.indexOf(ch);
  183. ; ch=tc.charAt(1);
  184. ; if (ch!=" ")
  185. ;  { ls1+=(al.indexOf(ch)*10)+" miles"; }
  186. ;  else ls1+="00"+" miles";
  187. ; document.isn.disp.value=ls1;
  188. ;}
  189. ;function dispKm(){
  190. ; ch=tc.charAt(0);
  191. ; km="";
  192. ; km+=al.indexOf(ch);
  193. ; ch=tc.charAt(1);
  194. ; if (ch!=" ")
  195. ; { km+=(al.indexOf(ch)*10); }
  196. ;  else{ km+="00"; }
  197. ;  num=0;
  198. ;  kml=km.length;
  199. ;  for (var i=kml-1;i>-1;i--){
  200. ;   cr=km.substring(i,i+1);
  201. ;   pos=ns.indexOf(cr);
  202. ;   num+=pos*b[kml-i-1];
  203. ;  }
  204. ;  km="";
  205. ;  km+=num*1.613;
  206. ;  pos=km.indexOf(".");
  207. ;  if (pos>-1){
  208. ;   km=km.substring(0,pos);
  209. ;  }
  210. ;  ls1+=km+" kilometers";
  211. ;  document.isn.disp.value=ls1;
  212. ;}
  213. ;// End Hiding -->
  214. ;</script>
  215.  
  216.  
  217.  
  218. [BODY_TEXT]
  219. ;
  220. ;<form name="isn">
  221. ;<table border="0" width="486" summary="">
  222. ;<tr><td colspan="3" align="center">
  223. ;<hr noshade><font color="blue">
  224. ;<b>`Caption`</b></font></td></tr>
  225. ;<tr><td align="center"><font color="blue">
  226. ;<b>Starting City</b></font><br><select name="isn1" size="12">
  227. ;<script language="JavaScript">
  228. ;<!-- Hide from JavaScript-Impaired Browsers
  229. ;/* Writing these from script instead of hard coding
  230. ;   them saves 6250 bytes of data delivery to visitor. */
  231. ;ls="";
  232. ;for (var i=0;i<61;i++){
  233. ; ls+='<OPTION VALUE="'+al.substring(i,i+1)+'" onClick=""';
  234. ; if (i==0){ls+=' SELECTED';}
  235. ; ls+='>'+a[i].substring(0,a[i].indexOf("*"));
  236. ; }
  237. ;document.write(ls);
  238. ;// End hiding -->
  239. ;</script>
  240. ;</select></td>
  241. ;<td align="center" valign="top"><font color="blue" size="1">
  242. ;<b>Instructions:</b></font>
  243. ;<br>Select starting city at left, destination at right. 
  244. ;Or, if you are feeling particularly contrary today, 
  245. ;vice versa. Then click below.
  246. ;<p><input type="button" name="but" value=" Get Distance " onClick="getMiles(this.form)">
  247. ;<br><input type="radio" name="rb" value="a" checked onClick="">Miles 
  248. ;<input type="radio" name="rb" value="b" onClick="">Kilometers
  249. ;<td align="center"><font color="blue">
  250. ;<b>Destination City</b></font>
  251. ;<br><select name="isn2" size="12">
  252. ;<script language="JavaScript">
  253. ;<!-- Hide from JavaScript-Impaired Browsers
  254. ;ls="";
  255. ;for (var i=0;i<61;i++){
  256. ; ls+='<OPTION VALUE="'+al.substring(i,i+1)+'" onClick=""';
  257. ; if (i==1){ls+=' SELECTED';}
  258. ; ls+='>'+a[i].substring(0,a[i].indexOf("*"));
  259. ; }
  260. ;document.write(ls);
  261. ;// End hiding -->
  262. ;</script>
  263. ;</select></td></tr>
  264. ;<tr><td colspan="3" align="center">
  265. ;<table border="2" summary="">
  266. ;<tr><td><input type="text" name="disp" value="" size="80">
  267. ;</td></tr></table></td></tr>
  268. ;<tr><td colspan=3><hr noshade></td></tr>
  269. ;</table>
  270. ;</form>
  271. ;
  272.  
  273. [`Caption`]
  274. Kind=S
  275. Value=Driving Distances between Selected USA Cities
  276.  
  277.  
  278.